﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BaseEntities;
using DataAccess;

namespace BusinessLogic
{
    public class WithdrawLogic
    {

        public static decimal getBalance(Card card)
        {
            return WithdrawDataAccess.getBalance(card);
        }
        public static bool CheckWithdrawCash(decimal amount, Card card)
        {
            return WithdrawDataAccess.CheckWithdrawCash(amount, card);
        }
        public static bool CheckCashWithMinMaxValue(decimal amount, Card card)
        {
            return WithdrawDataAccess.CheckCashWithMinMaxValue(amount, card);
        }
        public static bool CheckCashWithMod(decimal amount, Card card)
        {
            return WithdrawDataAccess.CheckCashWithMod(amount, card);
        }
        // kiểm tra số tiền trong cây ATM
        public static decimal GetAllMoney()
        {
            return WithdrawDataAccess.GetAllMoney();
        }
        // cập nhật lại số dư tài khoản
        public static bool UpdateBalance(decimal amount, Card card, Account account)
        {
            if (WithdrawDataAccess.UpdateBalance(amount, card, account))
                return true;
            else
                return false;
        }
        // ghi lich su
        public static bool WriteLog(ATM atm, Card card, decimal amount)
        {
            if (WithdrawDataAccess.WriteLog(atm, card, amount) == true)
                return true;
            return false;
        }
        public static int returnAccountID(Card card)
        {
            return WithdrawDataAccess.returnAccountID(card);
        } 
    }
}
